using System.IO;

namespace RealDolmen.Helpers
{
    public class StreamIterator
    {
        #region Fields
        private TextReader TextReader;
        public string Current;
        public string Previous; 
        #endregion // Fields

        #region Properties
        public bool EndOfStream
        {
            get
            {
                return TextReader.Peek() < 0;
                //return StreamReader.EndOfStream; 
            }
        } 
        #endregion // Properties

        #region Constructor
        public StreamIterator(TextReader textReader)
        {
            TextReader = textReader;
        } 
        #endregion // Constructor

        #region Business Methods
        public string ReadCurrent()
        {
            Previous = Current;
            Current = TextReader.ReadLine();
            return Current;
        } 
        #endregion // Business Methods
    }
}